package top.mcwebsite.playandroid.common.network.impl.cookie

import android.content.Context
import android.content.SharedPreferences
import android.text.TextUtils
import android.util.Log
import okhttp3.Cookie
import okhttp3.CookieJar
import okhttp3.HttpUrl

class PlayAndroidCookieJar : CookieJar {
    override fun saveFromResponse(url: HttpUrl, cookies: List<Cookie>) {
        PersistentCookieStore.addCookies(url, cookies)
    }

    override fun loadForRequest(url: HttpUrl): List<Cookie> {
        return PersistentCookieStore.get(url).apply {
            Log.d("mengchen", this.toString())
        }
    }

}

